package com.beerandjesus.sportofkings.handicapper.model.brisnet.singlefile;

import org.apache.commons.lang.builder.ToStringBuilder;

import java.util.List;

public class HorseRaceImpl implements HorseRace {

	private Race race;
	private List<Horse> horses;
	/* (non-Javadoc)
	 * @see com.beerandjesus.sportofkings.handicapper.model.brisnet.singlefile.HorseRace#getRace()
	 */
	public Race getRace() {
		return race;
	}
	public void setRace(Race race) {
		this.race = race;
	}
	/* (non-Javadoc)
	 * @see com.beerandjesus.sportofkings.handicapper.model.brisnet.singlefile.HorseRace#getHorses()
	 */
	public List<Horse> getHorses() {
		return horses;
	}
	public void setHorses(List<Horse> horses) {
		this.horses = horses;
	}


    public String toString() {
        return ToStringBuilder.reflectionToString(this);
    }

    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;

        HorseRaceImpl horseRace = (HorseRaceImpl) o;

        if (horses != null ? !horses.equals(horseRace.horses) : horseRace.horses != null) return false;
        if (race != null ? !race.equals(horseRace.race) : horseRace.race != null) return false;

        return true;
    }

    public int hashCode() {
        int result;
        result = (race != null ? race.hashCode() : 0);
        result = 31 * result + (horses != null ? horses.hashCode() : 0);
        return result;
    }
}
